#include<bits/stdc++.h>
using namespace std;
int n,r[100009],ans;
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin>>n;
    for(int i=1;i<=n;++i)
        cin>>r[i];
    sort(r+1,r+n+1);
    ans=n;
    for(int i=1,lst=0,cnt;i<=n;)
    {
        cnt=0;
        while(i<n&&r[i]==r[i+1])
        {
            ++i;
            ++cnt;
        }
        ++cnt;
        ans-=min(lst,cnt);
        lst=max(lst,cnt);
        ++i;
    }
    cout<<ans;
    return 0;
}